<?php
/**
 * @Author: liuhongbin
 * @Email: 514660094@qq.com
 * @Date: 2019-02-12 16:15:10
 * @Description:
 * @LastEditors: liuhongbin
 * @LastEditTime: xxx
 */

namespace app\common\model\wechat;


use app\common\model\BaseModel;
use app\common\model\wechat\tralts\WechatModel;

class WechatRefund extends WechatBaseModel
{
    /**
     * 数据表主键
     * @var string
     */
    protected $pk = 'id';

    /**
     * 模型名称
     * @var string
     */
    protected $name = 'wechat_refund';

    /**
     * 字段类型或者格式转换
     * @var array
     */
    protected $type = [

    ];
    use WechatModel;

    public function getUserByOpenid()
    {
        $openid = (new WechatOrder())->where(['out_trade_no' => $this->out_trade_no])->column('openid');
        return (new WechatUser())->getUserByOpenid($openid);
    }
}